#include <iostream>

using namespace std;
const int N = 1e5 + 10, MOD = 1e9 + 7;
typedef long long LL;
int a[N];
LL gcd(LL a, LL b)
{
	return b == 0 ? a : gcd(b, a % b);
}
int main()
{
	int n; cin >> n;
	cin >> a[1];
	int gcd = a[1];
	for (int i = 2; i <= n; i++)
	{
		cin >> a[i];
		gcd = min(gcd, a[i]);
	}
	LL ret = 1;
	for (int i = 1; i <= n; i++)
	{
		ret = ret * (a[i] / gcd) % MOD;
	}
	cout << gcd << " " << ret << endl;
	return 0;
}